import { getcontentApi } from "../../utils/api";
const contentdata = {
  state() {
    // 获取最近在看的数据
    return {
      contentlist: [],
    };
  },
  mutations: {
    //  改变最近在看的数据
    changecontent(state, payload) {
      state.contentlist = payload;
    },
  },
  actions: {
    async getcontentdata({ commit }) {
      const res = await getcontentApi();
      commit("changecontent", res);
    },
  },
};
export default contentdata;
